home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / The GIMP 2.2.8 / gimp-2.2.8-i586-setup.exe / {app} / share / gimp / 2.0 / scripts / gimp-labels.scm < prev    next >
Encoding:
Text File  |  2005-06-30  |  7.0 KB  |  175 lines

  1. ; The GIMP -- an image manipulation program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ; www.gimp.org web labels
  4. ; Copyright (c) 1997 Adrian Likins
  5. ; aklikins@eos.ncsu.edu
  6. ;
  7. ; based on a idea by jtl (Jens  Lautenbacher)
  8. ; and improved by jtl
  9. ;
  10. ; This program is free software; you can redistribute it and/or modify
  11. ; it under the terms of the GNU General Public License as published by
  12. ; the Free Software Foundation; either version 2 of the License, or
  13. ; (at your option) any later version.
  14. ; This program is distributed in the hope that it will be useful,
  15. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. ; GNU General Public License for more details.
  18. ; You should have received a copy of the GNU General Public License
  19. ; along with this program; if not, write to the Free Software
  20. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. ;
  22. ;  **NOTE**  This fonts use some very common fonts, that are typically
  23. ;  bitmap fonts on most installations. If you want better quality versions
  24. ;  you need to grab the urw font package form www.gimp.org/fonts.html
  25. ;  and install as indicated. This will replace the some current bitmap fonts
  26. ;  with higher quality vector fonts. This is how the actual www.gimp.org
  27. ;  logos were created.
  28. ;
  29. ; ************************************************************************
  30. ; Changed on Feb 4, 1999 by Piet van Oostrum <piet@cs.uu.nl>
  31. ; For use with GIMP 1.1.
  32. ; All calls to gimp-text-* have been converted to use the *-fontname form.
  33. ; The corresponding parameters have been replaced by an SF-FONT parameter.
  34. ; ************************************************************************
  35.  
  36.  
  37. (define (script-fu-labels-gimp-org text font font-size text-color shadow-color bg-color rm-bg index num-colors color-thresh yoff xoff height)
  38.   (let* ((img (car (gimp-image-new 125 height RGB)))
  39.      (text-layer (car (gimp-text-fontname img -1 xoff yoff text 0
  40.                      TRUE font-size PIXELS
  41.                      font)))
  42.      (bg-layer (car (gimp-layer-new  img 125 height
  43.                      RGB-IMAGE "Background" 100 NORMAL-MODE)))
  44.      (shadow-layer (car (gimp-layer-copy text-layer TRUE))))
  45.  
  46.     (gimp-context-push)
  47.  
  48.     (gimp-image-undo-disable img)
  49.     (gimp-image-add-layer img shadow-layer 1)
  50.     (gimp-image-add-layer img bg-layer 2)
  51.     
  52.     (gimp-layer-set-preserve-trans text-layer TRUE)
  53.     (gimp-layer-set-preserve-trans shadow-layer TRUE)
  54.     
  55.     (gimp-context-set-background text-color)
  56.     (gimp-edit-fill text-layer BACKGROUND-FILL)
  57.  
  58.     (gimp-context-set-background bg-color)
  59.     (gimp-edit-fill bg-layer BACKGROUND-FILL)
  60.  
  61.     (gimp-context-set-background shadow-color)
  62.     (gimp-edit-fill shadow-layer BACKGROUND-FILL)
  63.     (gimp-layer-translate shadow-layer 1 1)
  64.  
  65.     (set! text-layer (car (gimp-image-flatten img)))
  66.     (gimp-layer-add-alpha text-layer)
  67.  
  68.     (if (= rm-bg TRUE)
  69.     (begin
  70.       (gimp-by-color-select text-layer bg-color
  71.                 color-thresh CHANNEL-OP-REPLACE TRUE FALSE 0 FALSE)
  72.       (gimp-edit-clear text-layer)
  73.       (gimp-selection-none img)))
  74.     
  75.     (if (= index TRUE)
  76.        (gimp-image-convert-indexed img FS-DITHER MAKE-PALETTE num-colors
  77.                     FALSE FALSE ""))
  78.     (gimp-image-undo-enable img)
  79.     (gimp-display-new img)
  80.  
  81.     (gimp-context-pop)))
  82.  
  83.  
  84. ;;;(define (script-fu-tube-button-label-gimp-org text rm-bg index)
  85. ;;;  (script-fu-labels-gimp-org text "nimbus sans" 14 "medium" "r" "normal" '(151 177 192) '(0 0 0) '(255 255 255) rm-bg index 15 1 8 0 30))
  86. ;;;
  87. ;;;(define (script-fu-tube-subbutton-label-gimp-org text rm-bg index)
  88. ;;;  (script-fu-labels-gimp-org text "nimbus sans" 12 "medium" "r" "normal" '(151 177 192) '(0 0 0) '(255 255 255) rm-bg index 15 1 7 0 24))
  89. ;;;  
  90. ;;;(define (script-fu-tube-subsubbutton-label-gimp-org text rm-bg index)
  91. ;;;  (script-fu-labels-gimp-org text "nimbus sans" 10 "medium" "r" "normal" '(151 177 192) '(0 0 0) '(255 255 255) rm-bg index 15 1 6 0 18))
  92. ;;;
  93.  
  94. (define (script-fu-tube-button-label-gimp-org text rm-bg index)
  95.   (script-fu-labels-gimp-org text "helvetica" 14 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 8 0 30))
  96.  
  97. (define (script-fu-tube-subbutton-label-gimp-org text rm-bg index)
  98.   (script-fu-labels-gimp-org text "helvetica" 12 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 7 10 24))
  99.   
  100. (define (script-fu-tube-subsubbutton-label-gimp-org text rm-bg index)
  101.   (script-fu-labels-gimp-org text "helvetica" 10 '(86 114 172) '(255 255 255) '(255 255 255) rm-bg index 15 1 6 20 18))
  102.  
  103.  
  104. (script-fu-register "script-fu-tube-button-label-gimp-org"
  105.             _"_Tube Button Label..."
  106.             "Tube Button Label Header for gimp.org"
  107.             "Adrian Likins & Jens Lautenbacher"
  108.             "Adrian Likins & Jens Lautenbacher"
  109.             "1997"
  110.             ""
  111.             SF-STRING _"Text"              "?"
  112.             SF-TOGGLE _"Remove background" TRUE
  113.             SF-TOGGLE _"Index image"       TRUE)
  114.  
  115. (script-fu-menu-register "script-fu-tube-button-label-gimp-org"
  116.              _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Classic.Gimp.Org")
  117.  
  118.  
  119. (script-fu-register "script-fu-tube-subbutton-label-gimp-org"
  120.             _"T_ube Sub-Button Label..."
  121.             "Tube Button Label Header for gimp.org"
  122.             "Adrian Likins & Jens Lautenbacher"
  123.             "Adrian Likins & Jens Lautenbacher"
  124.             "1997"
  125.             ""
  126.             SF-STRING _"Text"              "?"
  127.             SF-TOGGLE _"Remove background" TRUE
  128.             SF-TOGGLE _"Index image"       TRUE)
  129.  
  130. (script-fu-menu-register "script-fu-tube-subbutton-label-gimp-org"
  131.              _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Classic.Gimp.Org")
  132.  
  133.  
  134. (script-fu-register "script-fu-tube-subsubbutton-label-gimp-org"
  135.             _"Tub_e Sub-Sub-Button Label..."
  136.             "Tube Button Label Header for gimp.org"
  137.             "Adrian Likins & Jens Lautenbacher"
  138.             "Adrian Likins & Jens Lautenbacher"
  139.             "1997"
  140.             ""
  141.             SF-STRING _"Text"              "?"
  142.             SF-TOGGLE _"Remove background" TRUE
  143.             SF-TOGGLE _"Index image"       TRUE)
  144.  
  145. (script-fu-menu-register "script-fu-tube-subsubbutton-label-gimp-org"
  146.              _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Classic.Gimp.Org")
  147.  
  148.  
  149. (script-fu-register "script-fu-labels-gimp-org"
  150.             _"_General Tube Labels..."
  151.             "Tube Button Label Header for gimp.org"
  152.             "Adrian Likins & Jens Lautenbacher"
  153.             "Adrian Likins & Jens Lautenbacher"
  154.             "1997"
  155.             ""
  156.             SF-STRING     _"Text"               "Gimp.Org"
  157.             SF-FONT       _"Font"               "Sans"
  158.             SF-ADJUSTMENT _"Font size (pixels)" '(18 2 1000 1 10 0 1)
  159.              SF-COLOR      _"Text color"         '(130 165 235)
  160.              SF-COLOR      _"Shadow color"       '(0 0 0)
  161.             SF-COLOR      _"Background color"   '(255 255 255)
  162.             SF-TOGGLE     _"Remove background"  TRUE
  163.             SF-TOGGLE     _"Index image"        TRUE
  164.             SF-ADJUSTMENT _"Number of colors"   '(15 2 255 1 10 0 1)
  165.             SF-ADJUSTMENT _"Select-by-color threshold" '(1 1 256 1 10 0 1)
  166.             SF-ADJUSTMENT _"Offset X"           '(8 0 50 1 10 0 1)
  167.             SF-ADJUSTMENT _"Offset Y"           '(0 0 50 1 10 0 1)
  168.             SF-ADJUSTMENT _"Height"             '(30 2 1000 1 10 0 1))
  169.  
  170. (script-fu-menu-register "script-fu-labels-gimp-org"
  171.              _"<Toolbox>/Xtns/Script-Fu/Web Page Themes/Classic.Gimp.Org")
  172.